home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume22 / ecu / patch05b < prev    next >
Encoding:
Text File  |  1991-09-04  |  50.2 KB  |  1,874 lines

  1. Newsgroups: comp.sources.misc
  2. From: Warren Tucker <wht@n4hgf.GA.US>
  3. Subject:  v22i091:  ecu - ECU async comm package rev 3.10, Patch05b/5
  4. Message-ID: <1991Sep4.160147.28312@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: c1f00d15b9b5d0817498ffbe96c26550
  6. Date: Wed, 4 Sep 1991 16:01:47 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Warren Tucker <wht@n4hgf.GA.US>
  10. Posting-number: Volume 22, Issue 91
  11. Archive-name: ecu/patch05b
  12. Environment: SCO, XENIX, ISC, SUNOS4.1, SYSVR4
  13. Patch-To: ecu: Volume 21, Issue 53-89
  14.  
  15. #!/bin/sh
  16. # this is p5.02 (part 2 of ecu/patch05)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file PATCH5.01 continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 2; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping PATCH5.01'
  34. else
  35. echo 'x - continuing file PATCH5.01'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'PATCH5.01' &&
  37. X- #if defined(M_SYSV)
  38. X  #include <memory.h>
  39. X- #endif
  40. X  #include <sys/stat.h>
  41. X  #include <fcntl.h>
  42. X  #if !defined(OMIT_TERMIO_REFERENCES)
  43. X  #include <termio.h>
  44. X  #endif
  45. X  
  46. X  #if defined(M_UNIX)
  47. X  #undef M_XENIX        /* we don't want this defined in UNIX world */
  48. X--- 34,64 ----
  49. X  #include <errno.h>
  50. X  #include <sys/timeb.h>
  51. X  #include <string.h>
  52. X  #include <memory.h>
  53. X  #include <sys/stat.h>
  54. X  #include <fcntl.h>
  55. X+ 
  56. X  #if !defined(OMIT_TERMIO_REFERENCES)
  57. X+ #if defined(sun)
  58. X  #include <termio.h>
  59. X+ #define termio termios
  60. X+ #undef TCGETA
  61. X+ #undef TCSETA
  62. X+ #undef TCSETAW
  63. X+ #define TCGETA    TCGETS
  64. X+ #define TCSETA    TCSETS
  65. X+ #define TCSETAW    TCSETSW
  66. X+ #else
  67. X+ #include <termio.h>
  68. X+ #endif /* sun */
  69. X+ #endif /* OMIT_TERMIO_REFERENCES */
  70. X+ 
  71. X+ #if defined(sun) && defined(FASI)
  72. X+ #undef FASI
  73. X  #endif
  74. X+ #if defined(sun) && defined(MORSE)
  75. X+ #undef MORSE
  76. X+ #endif
  77. X  
  78. X  #if defined(M_UNIX)
  79. X  #undef M_XENIX        /* we don't want this defined in UNIX world */
  80. X***************
  81. X*** 174,182 ****
  82. X--- 196,220 ----
  83. X  extern int rcvr_pid;
  84. X  extern int xmtr_pid;
  85. X  
  86. X+ /*
  87. X+  * both of the following are set by xmtr_SIGINT_handler()
  88. X+  * 'sigint' reset by 1st detector/processor
  89. X+  * 'proc_interrupt' reset/handled by procedure monitor
  90. X+  *                  (execute_esd and execute_proc)
  91. X+  */
  92. X+ extern int sigint;
  93. X+ /* extern int proc_interrupt; <------ force using modules to declare it */
  94. X+ 
  95. X+ /*
  96. X+  * 'hz' is getenv("HZ"); that not found, the value from sys/param.h
  97. X+  * 'hzmsec' is ceiling(clock period) in milliseconds
  98. X+  */
  99. X  extern int hz;                /* HZ from environ or sys/param.h */
  100. X  extern ulong hzmsec;        /* clock period in msec rounded up */
  101. X  
  102. X+ /*
  103. X+  * tty (comm line) variables that are not in shared memory
  104. X+  */
  105. X  #if defined(DECLARE_LINEVARS_PUBLIC)
  106. X  char LLCKname[128];            /* lock file name */
  107. X  #if !defined(OMIT_TERMIO_REFERENCES)
  108. X***************
  109. X*** 244,249 ****
  110. X--- 282,289 ----
  111. X  extern ulong colors_alert;
  112. X  extern ulong colors_error;
  113. X  extern ulong colors_notify;
  114. X+ 
  115. X+ extern char *eculibdir;
  116. X  
  117. X  /*
  118. X   * param to lgets_timeout in eculine.c
  119. X*** /export/home/wht/src/ecu314/ecuDCE.c    Wed Sep  4 00:25:04 1991
  120. X--- ecuDCE.c    Tue Sep  3 19:56:31 1991
  121. X***************
  122. X*** 23,29 ****
  123. X  
  124. X  --------------------------------------------------------------------------*/
  125. X  /*+:EDITS:*/
  126. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
  127. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  128. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  129. X  /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
  130. X--- 23,29 ----
  131. X  
  132. X  --------------------------------------------------------------------------*/
  133. X  /*+:EDITS:*/
  134. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
  135. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  136. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  137. X  /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
  138. X***************
  139. X*** 44,57 ****
  140. X  #include "relop.h"
  141. X  
  142. X  long time();
  143. X- long Nap();
  144. X  
  145. X  char *make_char_graphic();
  146. X  void DCE_hangup();
  147. X  
  148. X- extern int rcvr_pid;
  149. X- extern int sigint;
  150. X- extern int proc_interrupt;
  151. X  extern int proctrace;
  152. X  extern ulong colors_current;
  153. X  extern char kbdintr;
  154. X--- 44,53 ----
  155. X***************
  156. X*** 311,317 ****
  157. X  static char s32[32];
  158. X  LRWT    lr;
  159. X  
  160. X!     sigint = 0;
  161. X      s32[0] = 0;
  162. X      lr.to1 = msec_to_wait;
  163. X      lr.to2 = 200L;
  164. X--- 307,314 ----
  165. X  static char s32[32];
  166. X  LRWT    lr;
  167. X  
  168. X!     if(sigint)
  169. X!         return("!Interrupted");
  170. X      s32[0] = 0;
  171. X      lr.to1 = msec_to_wait;
  172. X      lr.to2 = 200L;
  173. X***************
  174. X*** 322,329 ****
  175. X      lr.echo_flag = 0;
  176. X      lgets_timeout(&lr);
  177. X  
  178. X! /* reset any interrupt indication since we look at string */
  179. X!     sigint = 0;
  180. X  
  181. X      return(lr.buffer);
  182. X  }    /* end of DCE_get_result */
  183. X--- 319,326 ----
  184. X      lr.echo_flag = 0;
  185. X      lgets_timeout(&lr);
  186. X  
  187. X!     if(sigint)
  188. X!         return("!Interrupted");
  189. X  
  190. X      return(lr.buffer);
  191. X  }    /* end of DCE_get_result */
  192. X***************
  193. X*** 342,350 ****
  194. X      if(shm->Lmodem_already_init)
  195. X          return(0);
  196. X  
  197. X-     sigint = 0;
  198. X      DCE_read_modem_init();
  199. X  
  200. X      lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
  201. X      (void)Nap(200L);
  202. X      lflush(0);
  203. X--- 339,347 ----
  204. X      if(shm->Lmodem_already_init)
  205. X          return(0);
  206. X  
  207. X      DCE_read_modem_init();
  208. X  
  209. X+     ttymode(2);
  210. X      lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
  211. X      (void)Nap(200L);
  212. X      lflush(0);
  213. X***************
  214. X*** 459,465 ****
  215. X      pputc(NL);
  216. X      lputc_paced(20,CRET);
  217. X      itmp = 0;
  218. X!     if(check_queued_sigint())
  219. X          return(-1);
  220. X      while(itmp != CRET)
  221. X      {
  222. X--- 456,462 ----
  223. X      pputc(NL);
  224. X      lputc_paced(20,CRET);
  225. X      itmp = 0;
  226. X!     if(sigint || check_queued_sigint())
  227. X          return(-1);
  228. X      while(itmp != CRET)
  229. X      {
  230. X***************
  231. X*** 468,474 ****
  232. X              pputs("missed expected carriage return\n");
  233. X              return(-1);
  234. X          }
  235. X!         if(check_queued_sigint())
  236. X              return(-1);
  237. X      }
  238. X      return(0);
  239. X--- 465,471 ----
  240. X              pputs("missed expected carriage return\n");
  241. X              return(-1);
  242. X          }
  243. X!         if(sigint || check_queued_sigint())
  244. X              return(-1);
  245. X      }
  246. X      return(0);
  247. X***************
  248. X*** 607,613 ****
  249. X          }
  250. X  #endif /* WHT */
  251. X  
  252. X!         if(check_queued_sigint())
  253. X              goto SEND_CMD_ERROR;
  254. X  
  255. X          if(DCE_send_cmd(s128))
  256. X--- 604,610 ----
  257. X          }
  258. X  #endif /* WHT */
  259. X  
  260. X!         if(sigint || check_queued_sigint())
  261. X              goto SEND_CMD_ERROR;
  262. X  
  263. X          if(DCE_send_cmd(s128))
  264. X***************
  265. X*** 620,634 ****
  266. X          strcpy(s64,DCE_get_result(s7 * 2 * 1000L));
  267. X          result = s64;
  268. X  
  269. X!         if(!strcmp(result,interrupted_string))
  270. X          {
  271. X              setcolor(colors_error);
  272. X              pprintf("%s\n",result);
  273. X-             lputc(0);                /* make modem go on hook */
  274. X-             (void)Nap(40L);
  275. X-             lputc(0);
  276. X              sigint = 0;
  277. X!             (void)DCE_get_result(2000L);    /* wait for NO CARRIER */
  278. X              erc = eCONINT;
  279. X              iv[0] = 2;
  280. X              DCE_report_iv_set(0);
  281. X--- 617,630 ----
  282. X          strcpy(s64,DCE_get_result(s7 * 2 * 1000L));
  283. X          result = s64;
  284. X  
  285. X!         if(sigint || !strcmp(result,interrupted_string))
  286. X          {
  287. X              setcolor(colors_error);
  288. X              pprintf("%s\n",result);
  289. X              sigint = 0;
  290. X!             lputc(0);            /* send char in case DTR ignored */
  291. X!             ltoggle_dtr();                    /* force on hook */
  292. X!             (void)DCE_get_result(2000L);    /* wait for any result code */
  293. X              erc = eCONINT;
  294. X              iv[0] = 2;
  295. X              DCE_report_iv_set(0);
  296. X***************
  297. X*** 648,657 ****
  298. X                  }
  299. X              }
  300. X  CONNECTED:
  301. X! #ifdef WHT    /* if xterm, put connection in title bar */
  302. X              sprintf(s128,"connected to %s",shm->Llogical);
  303. X              xterm_title(s128,1);
  304. X-             bell_notify(XBELL_C);
  305. X  #endif
  306. X              setcolor(colors_success);
  307. X              pprintf("%s\n",result);
  308. X--- 644,653 ----
  309. X                  }
  310. X              }
  311. X  CONNECTED:
  312. X! #if defined(WHT) || defined(XTERM_FRIEND)
  313. X!             /* if xterm, put connection in title bar */
  314. X              sprintf(s128,"connected to %s",shm->Llogical);
  315. X              xterm_title(s128,1);
  316. X  #endif
  317. X              setcolor(colors_success);
  318. X              pprintf("%s\n",result);
  319. X***************
  320. X*** 661,669 ****
  321. X              ecu_log_event(getpid(),s128);
  322. X              if(isalpha(shm->Llogical[0]))
  323. X              {
  324. X!                 if(keyset_read(shm->Llogical))
  325. X!                     keyset_init();
  326. X!                 else
  327. X                      pprintf("[autoloaded fkeys for %s]\n",shm->Llogical);
  328. X              }
  329. X              shmx_connect();
  330. X--- 657,663 ----
  331. X              ecu_log_event(getpid(),s128);
  332. X              if(isalpha(shm->Llogical[0]))
  333. X              {
  334. X!                 if(!keyset_read(shm->Llogical))
  335. X                      pprintf("[autoloaded fkeys for %s]\n",shm->Llogical);
  336. X              }
  337. X              shmx_connect();
  338. X***************
  339. X*** 688,695 ****
  340. X      }
  341. X  
  342. X  SEND_CMD_ERROR: ;
  343. X!     if(sigint || proc_interrupt)
  344. X      {
  345. X          result = interrupted_string;
  346. X          iv[0] = 2;
  347. X          DCE_report_iv_set(0);
  348. X--- 682,690 ----
  349. X      }
  350. X  
  351. X  SEND_CMD_ERROR: ;
  352. X!     if(sigint)
  353. X      {
  354. X+         sigint = 0;
  355. X          result = interrupted_string;
  356. X          iv[0] = 2;
  357. X          DCE_report_iv_set(0);
  358. X***************
  359. X*** 815,822 ****
  360. X          ulong colors_at_entry = colors_current;
  361. X              pargv[0] = shm->Llogical;
  362. X              pargv[1] = "!REDIAL;";
  363. X-             ttymode(2);
  364. X              sigint = 0;
  365. X              erc = do_proc(2,pargv);
  366. X              proc_file_reset();
  367. X              ttymode(1);
  368. X--- 810,817 ----
  369. X          ulong colors_at_entry = colors_current;
  370. X              pargv[0] = shm->Llogical;
  371. X              pargv[1] = "!REDIAL;";
  372. X              sigint = 0;
  373. X+             ttymode(2);
  374. X              erc = do_proc(2,pargv);
  375. X              proc_file_reset();
  376. X              ttymode(1);
  377. X***************
  378. X*** 898,904 ****
  379. X              shm->Llogical,shm->Ltelno,connect_secs,
  380. X              get_elapsed_time(connect_secs));
  381. X          ecu_log_event(getpid(),s128);
  382. X! #ifdef WHT    /* if xterm, put connection in title bar */
  383. X          xterm_title("disconnected",1);
  384. X  #endif
  385. X          /*
  386. X--- 893,899 ----
  387. X              shm->Llogical,shm->Ltelno,connect_secs,
  388. X              get_elapsed_time(connect_secs));
  389. X          ecu_log_event(getpid(),s128);
  390. X! #if defined(WHT) || defined(XTERM_FRIEND)
  391. X          xterm_title("disconnected",1);
  392. X  #endif
  393. X          /*
  394. X*** /export/home/wht/src/ecu314/ecuLCK.c    Wed Sep  4 00:24:49 1991
  395. X--- ecuLCK.c    Sun Sep  1 17:10:35 1991
  396. X***************
  397. X*** 170,176 ****
  398. X      if(itmp = is_active_lock(lock_file_name))
  399. X          return(itmp);
  400. X  
  401. X! #if (defined(M_XENIX) || defined(M_UNIX)) && defined(SCO_TTY_NAMING)
  402. X      if(isalpha(lock_file_name[itmp = strlen(lock_file_name) - 1]))
  403. X      {
  404. X          lock_file_name[itmp] ^= 0x20;    /* lower->upper, upper->lower */
  405. X--- 170,176 ----
  406. X      if(itmp = is_active_lock(lock_file_name))
  407. X          return(itmp);
  408. X  
  409. X! #if defined(M_SYSV)  /* && defined(SCO_TTY_NAMING) */
  410. X      if(isalpha(lock_file_name[itmp = strlen(lock_file_name) - 1]))
  411. X      {
  412. X          lock_file_name[itmp] ^= 0x20;    /* lower->upper, upper->lower */
  413. X*** /export/home/wht/src/ecu314/ecucmd.h    Wed Sep  4 00:24:50 1991
  414. X--- ecucmd.h    Sun Sep  1 19:28:17 1991
  415. X***************
  416. X*** 3,8 ****
  417. X--- 3,10 ----
  418. X      wht@n4hgf.Mt-Park.GA.US
  419. X  --------------------------------------------------------------------------*/
  420. X  /*+:EDITS:*/
  421. X+ /*:09-01-1991-18:12-wht@n4hgf2-add setline */
  422. X+ /*:09-01-1991-18:11-wht@n4hgf2-add setline */
  423. X  /*:08-17-1991-16:41-wht@n4hgf-add kbdtest */
  424. X  /*:07-29-1991-17:57-wht@n4hgf-add memstat */
  425. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  426. X***************
  427. X*** 171,176 ****
  428. X--- 173,179 ----
  429. X  int pcmd_scrdump() Z
  430. X  int pcmd_send() Z
  431. X  int pcmd_set() Z
  432. X+ int pcmd_setline() Z
  433. X  int pcmd_sk() Z
  434. X  int pcmd_ss() Z
  435. X  int pcmd_sx() Z
  436. X***************
  437. X*** 272,278 ****
  438. X      { "log",    3,CTlog,    "session logging control",        0,         ccG },
  439. X      { "logevent",0,0,        "",                                pcmd_logevent,0},
  440. X      { "lookfor",0,0,        "",                                pcmd_lookfor,0 },
  441. X! #if defined(WHT) && defined(MALLOC_3X)
  442. X      { "memstat",3,CTmemstat,"",                                0,          0  },
  443. X  #endif
  444. X  /*    { "mkdir",    3,CTmkdir,    "mkdir <dirname>",                pcmd_mkdir, ccG}, */
  445. X--- 275,281 ----
  446. X      { "log",    3,CTlog,    "session logging control",        0,         ccG },
  447. X      { "logevent",0,0,        "",                                pcmd_logevent,0},
  448. X      { "lookfor",0,0,        "",                                pcmd_lookfor,0 },
  449. X! #if defined(MALLOC_3X)
  450. X      { "memstat",3,CTmemstat,"",                                0,          0  },
  451. X  #endif
  452. X  /*    { "mkdir",    3,CTmkdir,    "mkdir <dirname>",                pcmd_mkdir, ccG}, */
  453. X***************
  454. X*** 310,315 ****
  455. X--- 313,319 ----
  456. X      { "sdname",    3,CTsdname,    "select screen dump name",        0,         ccC },
  457. X      { "send",    0,0,        "",                                pcmd_send,  0  },
  458. X      { "set",    0,0,        "",                                pcmd_set,   0  },
  459. X+     { "setline",0,0,        "",                                pcmd_setline,0 },
  460. X      { "sgr",    2,CTsgr,    "send command/get response",    0,         ccC },
  461. X      { "sk",        2,CTsk,        "send via C-Kermit",            pcmd_sk,   ccT },
  462. X      { "ss",        2,CTss,        "send via SEAlink",                pcmd_ss,   ccT },
  463. X*** /export/home/wht/src/ecu314/ecufinsert.c    Wed Sep  4 00:24:40 1991
  464. X--- ecufinsert.c    Tue Sep  3 18:58:23 1991
  465. X***************
  466. X*** 21,27 ****
  467. X  #include "ecukey.h"
  468. X  #include "ecutty.h"
  469. X  
  470. X- extern int sigint;
  471. X  extern char kbdintr;        /* current input INTR */
  472. X  extern ulong colors_current;
  473. X  extern ulong colors_alert;
  474. X--- 21,26 ----
  475. X***************
  476. X*** 111,116 ****
  477. X--- 110,117 ----
  478. X  #endif
  479. X  char *make_char_graphic();
  480. X  
  481. X+     sigint = 0;
  482. X+ 
  483. X      if(narg > 1)
  484. X      {
  485. X          strncpy(s256,arg[1],sizeof(s256));    
  486. X***************
  487. X*** 193,199 ****
  488. X      lxon_xoff(IXON);                    /* set it for us */
  489. X  #endif
  490. X  
  491. X-     sigint = 0;    /* reset SIGINT flag */
  492. X      while(fgets(file_string,sizeof(file_string),fp))
  493. X      {
  494. X      int xmit_len = strlen(file_string);
  495. X--- 194,199 ----
  496. X***************
  497. X*** 304,309 ****
  498. X--- 304,310 ----
  499. X  
  500. X      if(sigint)
  501. X      {
  502. X+         sigint = 0;
  503. X          setcolor(colors_error);
  504. X          ff(se,"--> Interrupted\r\n");
  505. X          setcolor(colors_at_entry);
  506. X*** /export/home/wht/src/ecu314/ecufkey.c    Wed Sep  4 00:24:51 1991
  507. X--- ecufkey.c    Mon Sep  2 22:56:14 1991
  508. X***************
  509. X*** 14,42 ****
  510. X      keyset_read(name)
  511. X      xf_to_KDEt(xf)
  512. X  
  513. X- I had a problem with gcc 1.39 when I added -fcall-used-...  in
  514. X- that the assembler code generated for keyset_display() had a
  515. X- syntax error When it blows up, I did:
  516. X- 
  517. X-   make
  518. X-     ecufkey.c:
  519. X-     aline: syntax error in line blah
  520. X-   make -n ecufkey.o > tmp
  521. X-   edit tmp to add -S after -c
  522. X-   source tmp  -or-  . tmp
  523. X-   as ecufkey.s
  524. X-     aline: syntax error in line blah
  525. X-   edit ecufkey.s, find line blah,
  526. X-     change movl operand from '.Lxxx' to '$.Lxxx'
  527. X-   as ecufkey.s
  528. X-   make --- resume normal making
  529. X- 
  530. X- so it must be a little boog. There's a workaround in place ( using
  531. X- a function in ecuutil.c, a separate compilation unit).
  532. X- 
  533. X- GCC 1.40 fixed the bug, so #ifdef GCC140, don't use the kludge.
  534. X  ------------------------------------------------------------------*/
  535. X  /*+:EDITS:*/
  536. X  /*:08-16-1991-00:11-wht@n4hgf-keyset_init loads default keyset if found */
  537. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  538. X  /*:07-12-1991-13:57-wht@n4hgf-GCC140 fix update */
  539. X--- 14,23 ----
  540. X      keyset_read(name)
  541. X      xf_to_KDEt(xf)
  542. X  
  543. X  ------------------------------------------------------------------*/
  544. X  /*+:EDITS:*/
  545. X+ /*:09-01-1991-05:16-wht@n4hgf2-allow comments and whitespace after names */
  546. X+ /*:08-31-1991-13:21-wht@n4hgf2-look for keys file in ECULIBDIR */
  547. X  /*:08-16-1991-00:11-wht@n4hgf-keyset_init loads default keyset if found */
  548. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  549. X  /*:07-12-1991-13:57-wht@n4hgf-GCC140 fix update */
  550. X***************
  551. X*** 123,134 ****
  552. X      tkde->str[0] = 0x7F;    /* this key is intercepted by kbd read routine */
  553. X      tkde->count = 0;
  554. X  
  555. X-     keyset_read("default");
  556. X- 
  557. X  }    /* end of keyset_init */
  558. X  
  559. X  /*+-------------------------------------------------------------------------
  560. X!     kde_fgets(buf,bufsize,fp)
  561. X  --------------------------------------------------------------------------*/
  562. X  int
  563. X  kde_fgets(buf,bufsize,fp)
  564. X--- 104,120 ----
  565. X      tkde->str[0] = 0x7F;    /* this key is intercepted by kbd read routine */
  566. X      tkde->count = 0;
  567. X  
  568. X  }    /* end of keyset_init */
  569. X  
  570. X  /*+-------------------------------------------------------------------------
  571. X!     kde_fgets(buf,bufsize,fp) - read and evaluate key file line
  572. X! 
  573. X! Returns:
  574. X!     KDEt_COMMENT     comment or blank line (null, all blank or "#"
  575. X!                      as non-blank)
  576. X!     KDEt_NAME        "name" (non "#\t " in column 1)
  577. X!     KDEt_ENTRY       "entry" ("\t " in column 1)
  578. X!     KDEt_EOF         end of file
  579. X  --------------------------------------------------------------------------*/
  580. X  int
  581. X  kde_fgets(buf,bufsize,fp)
  582. X***************
  583. X*** 146,152 ****
  584. X  
  585. X      if(!(itmp = strlen(buf)))
  586. X          return(KDEt_COMMENT);
  587. X!     if(buf[itmp - 1] == '\n')
  588. X      {
  589. X          buf[itmp - 1] = 0;
  590. X          itmp--;
  591. X--- 132,138 ----
  592. X  
  593. X      if(!(itmp = strlen(buf)))
  594. X          return(KDEt_COMMENT);
  595. X!     if(buf[itmp - 1] == NL)
  596. X      {
  597. X          buf[itmp - 1] = 0;
  598. X          itmp--;
  599. X***************
  600. X*** 285,291 ****
  601. X  /*+-------------------------------------------------------------------------
  602. X      keyset_define_key(bufptr)
  603. X  
  604. X! return 0 if no error, 1 if done, -1 if error
  605. X  --------------------------------------------------------------------------*/
  606. X  int
  607. X  keyset_define_key(bufptr)
  608. X--- 271,277 ----
  609. X  /*+-------------------------------------------------------------------------
  610. X      keyset_define_key(bufptr)
  611. X  
  612. X! return 0 if no error, -1 if error
  613. X  --------------------------------------------------------------------------*/
  614. X  int
  615. X  keyset_define_key(bufptr)
  616. X***************
  617. X*** 298,318 ****
  618. X  char token_separator[8];
  619. X  char *token;
  620. X  char *syntax = "syntax error in key definition: %s\n";
  621. X- char *str_token();
  622. X  
  623. X!     if(itmp = strlen(bufptr))    /* itmp = len; if > 0 ... */
  624. X!         bufptr[--itmp] = 0;        /* ... strip trailing NL */
  625. X      if(!itmp)
  626. X          return(0);
  627. X  
  628. X!     if(bufptr[0] == '#')        /* comment? */
  629. X          return(0);
  630. X-     if((*bufptr != 0x20) && (*bufptr != TAB))    /* if no leading space */
  631. X-         return(1);
  632. X-     if(*bufptr == 0)                    /* if line all blank, break */
  633. X-         return(1);
  634. X  
  635. X!     while((*bufptr == 0x20) || (*bufptr == TAB))    /* strip lding sp/tab */
  636. X          bufptr++;
  637. X  
  638. X      token_number = 0;
  639. X--- 284,299 ----
  640. X  char token_separator[8];
  641. X  char *token;
  642. X  char *syntax = "syntax error in key definition: %s\n";
  643. X  
  644. X!     if((itmp = strlen(bufptr)) && (bufptr[itmp - 1] == NL))
  645. X!         bufptr[--itmp] = 0;        /* strip trailing NL */
  646. X      if(!itmp)
  647. X          return(0);
  648. X  
  649. X!     if((*bufptr != SPACE) && (*bufptr != TAB))    /* if no leading space */
  650. X          return(0);
  651. X  
  652. X!     while((*bufptr == SPACE) || (*bufptr == TAB))    /* strip lding sp/tab */
  653. X          bufptr++;
  654. X  
  655. X      token_number = 0;
  656. X***************
  657. X*** 394,452 ****
  658. X  char *name;
  659. X  {
  660. X  register itmp = 0;
  661. X! register char *cptr;
  662. X! static char ecukeys_name[128];
  663. X! char readkde_buf[128];
  664. X  FILE *fp_keys;
  665. X  
  666. X!     if(!ecukeys_name[0])
  667. X      {
  668. X!         get_home_dir(ecukeys_name);
  669. X!         strcat(ecukeys_name,"/.ecu/keys");
  670. X      }
  671. X  
  672. X-     if((fp_keys = fopen(ecukeys_name,"r")) == NULL)
  673. X-         return(-1);
  674. X- 
  675. X  /* find keyset name */
  676. X!     while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
  677. X      {
  678. X!         if(readkde_buf[0] == '#')        /* comment? */
  679. X!             continue;
  680. X!         if(itmp = strlen(readkde_buf))    /* itmp = len; if > 0 ... */
  681. X!             readkde_buf[--itmp] = 0;    /* ... strip trailing NL */
  682. X!         if(!itmp)
  683. X!             continue;
  684. X!         if(strcmp(readkde_buf,name) == 0)
  685. X          {
  686. X!             itmp = 1;        /* indicate success */
  687. X              break;
  688. X          }
  689. X-         itmp = 0;            /* if loop terminates w/o find, failure */
  690. X      }
  691. X!     if(!itmp)
  692. X      {
  693. X!         fclose(fp_keys);
  694. X          return(-2);
  695. X      }
  696. X  
  697. X-     keyset_init();    /* clear any previous key defns */
  698. X-     strncpy(keyset_name,name,sizeof(keyset_name));
  699. X-     keyset_name[sizeof(keyset_name) - 1] = 0;
  700. X- 
  701. X  /*
  702. X   * read past any other keyset names matching this set
  703. X   * process 1st line of definition when found
  704. X   */
  705. X!     while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
  706. X      {
  707. X!         cptr = readkde_buf;                /* first call to str_token, -> buff */
  708. X!         if((*cptr == 0x20) || (*cptr == TAB))    /* if leading space */
  709. X          {
  710. X!             if((itmp = keyset_define_key(readkde_buf)) < 0)
  711. X              {
  712. X                  fclose(fp_keys);
  713. X!                 keyset_name[0] = 0;
  714. X                  return(-3);
  715. X              }
  716. X              break;
  717. X--- 375,426 ----
  718. X  char *name;
  719. X  {
  720. X  register itmp = 0;
  721. X! int KDEt;
  722. X! char ecukeys_name[128];
  723. X! char s128[128];
  724. X  FILE *fp_keys;
  725. X  
  726. X!     get_home_dir(ecukeys_name);
  727. X!     strcat(ecukeys_name,"/.ecu/keys");    /* somebody will core dump here 1 day */
  728. X! 
  729. X!     if(!(fp_keys = fopen(ecukeys_name,"r")))
  730. X      {
  731. X!         strcpy(ecukeys_name,eculibdir);
  732. X!         strcat(ecukeys_name,"/keys");
  733. X!         if(!(fp_keys = fopen(ecukeys_name,"r")))
  734. X!             return(-1);
  735. X      }
  736. X  
  737. X  /* find keyset name */
  738. X!     itmp = 0;
  739. X!     while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
  740. X      {
  741. X!         if((KDEt == KDEt_NAME) && !strcmp(s128,name))
  742. X          {
  743. X!             itmp = 1; /* success */
  744. X              break;
  745. X          }
  746. X      }
  747. X!     if(!itmp)                /* find match? */
  748. X      {
  749. X!         fclose(fp_keys);    /* nope */
  750. X          return(-2);
  751. X      }
  752. X  
  753. X  /*
  754. X   * read past any other keyset names matching this set
  755. X   * process 1st line of definition when found
  756. X   */
  757. X!     while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
  758. X      {
  759. X!         if((KDEt == KDEt_NAME) || (KDEt == KDEt_COMMENT))
  760. X!             continue;
  761. X!         else if(KDEt == KDEt_ENTRY)
  762. X          {
  763. X!             if(keyset_define_key(s128) < 0)
  764. X              {
  765. X                  fclose(fp_keys);
  766. X!                 keyset_init();
  767. X                  return(-3);
  768. X              }
  769. X              break;
  770. X***************
  771. X*** 456,473 ****
  772. X  /*
  773. X   * read rest of definition
  774. X   */
  775. X!     while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
  776. X      {
  777. X!         if((itmp = keyset_define_key(readkde_buf)) < 0)
  778. X          {
  779. X!             fclose(fp_keys);
  780. X!             keyset_name[0] = 0;
  781. X!             return(-3);
  782. X          }
  783. X-         else if(itmp)
  784. X-             break;
  785. X      }
  786. X  
  787. X      fclose(fp_keys);
  788. X      return(0);
  789. X  }    /* end of keyset_read */
  790. X--- 430,457 ----
  791. X  /*
  792. X   * read rest of definition
  793. X   */
  794. X!     while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
  795. X      {
  796. X!         switch(KDEt)
  797. X          {
  798. X!             case KDEt_COMMENT:
  799. X!                 continue;
  800. X!             case KDEt_ENTRY:
  801. X!                 if(keyset_define_key(s128) < 0)
  802. X!                 {
  803. X!                     fclose(fp_keys);
  804. X!                     keyset_init();
  805. X!                     return(-3);
  806. X!                 }
  807. X!                 break;
  808. X!             default:
  809. X!                 goto DONE;
  810. X          }
  811. X      }
  812. X  
  813. X+ DONE:
  814. X+     strncpy(keyset_name,name,sizeof(keyset_name));
  815. X+     keyset_name[sizeof(keyset_name) - 1] = 0;
  816. X      fclose(fp_keys);
  817. X      return(0);
  818. X  }    /* end of keyset_read */
  819. X*** /export/home/wht/src/ecu314/ecufork.c    Wed Sep  4 00:24:40 1991
  820. X--- ecufork.c    Sun Sep  1 03:14:04 1991
  821. X***************
  822. X*** 12,17 ****
  823. X--- 12,18 ----
  824. X  
  825. X  --------------------------------------------------------------------------*/
  826. X  /*+:EDITS:*/
  827. X+ /*:08-29-1991-01:56-wht@n4hgf2-use max esd size instead of 5120 */
  828. X  /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  829. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  830. X  /*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  831. X***************
  832. X*** 18,23 ****
  833. X--- 19,25 ----
  834. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  835. X  
  836. X  #include "ecu.h"
  837. X+ #include "esd.h"
  838. X  #include "ecufork.h"
  839. X  
  840. X  extern int rcvr_pid;
  841. X***************
  842. X*** 234,240 ****
  843. X--- 236,250 ----
  844. X  char *cmdstr;
  845. X  {
  846. X  char *cmdpath;
  847. X+ #ifdef M_I286
  848. X  #define MAX_EXEC_ARG 512
  849. X+ #else
  850. X+ #if defined(M_UNIX) || defined(ISC)
  851. X+ #define MAX_EXEC_ARG 1024
  852. X+ #else
  853. X+ #define MAX_EXEC_ARG 2048
  854. X+ #endif    /* M_UNIX || ISC */
  855. X+ #endif    /* M_I286 */
  856. X  char *cmdargv[MAX_EXEC_ARG];
  857. X  int itmp;
  858. X  int execpid;
  859. X***************
  860. X*** 437,443 ****
  861. X          return(-1);
  862. X      }
  863. X  
  864. X!     if(!(*expcmd = malloc(expcmd_size = 5120)))
  865. X      {
  866. X          close(stdout_pipe[P_READ]);
  867. X          close(stderr_pipe[P_READ]);
  868. X--- 447,453 ----
  869. X          return(-1);
  870. X      }
  871. X  
  872. X!     if(!(*expcmd = malloc(expcmd_size = ESD_MAXSIZE)))
  873. X      {
  874. X          close(stdout_pipe[P_READ]);
  875. X          close(stderr_pipe[P_READ]);
  876. X*** /export/home/wht/src/ecu314/ecuicmd.c    Wed Sep  4 00:24:51 1991
  877. X--- ecuicmd.c    Tue Sep  3 19:01:39 1991
  878. X***************
  879. X*** 46,52 ****
  880. X  extern char hello_str[];
  881. X  extern char keyset_name[];
  882. X  extern char rcvr_log_file[];    /* if rcvr_log!= 0,log filename */
  883. X- extern int sigint;
  884. X  extern int current_ttymode;
  885. X  extern long tty_escape_timeout;        /* timeout on waiting for char after ESC */
  886. X  extern int tcap_COLS;
  887. X--- 46,51 ----
  888. X***************
  889. X*** 63,69 ****
  890. X  extern int rcvr_log;            /* rcvr log active if != 0 */
  891. X  extern int rcvr_log_append;    /* if true, append, else scratch */
  892. X  extern int rcvr_log_raw;        /* if true, log all, else filter ctl chrs */
  893. X- extern int rcvr_pid;
  894. X  extern ulong colors_current;
  895. X  extern FILE *plog_fp;
  896. X  extern ESD  *plog_name;
  897. X--- 62,67 ----
  898. X***************
  899. X*** 585,591 ****
  900. X                  case  0: keyset_display(); break;
  901. X                  case -1: ff(se," cannot find ~/.ecu/keys\r\n"); break;
  902. X                  case -2: ff(se," not found in ~/.ecu/keys\r\n"); break;
  903. X!                 case -3: ff(se," syntax error\r\n"); break; 
  904. X              }
  905. X          }
  906. X          break;
  907. X--- 583,593 ----
  908. X                  case  0: keyset_display(); break;
  909. X                  case -1: ff(se," cannot find ~/.ecu/keys\r\n"); break;
  910. X                  case -2: ff(se," not found in ~/.ecu/keys\r\n"); break;
  911. X!                 case -3: ff(se," syntax error ... default restored\r\n");
  912. X!                 default:
  913. X!                     keyset_init();
  914. X!                     keyset_read("default");
  915. X!                     break; 
  916. X              }
  917. X          }
  918. X          break;
  919. X*** /export/home/wht/src/ecu314/ecuicmhist.c    Wed Sep  4 00:25:05 1991
  920. X--- ecuicmhist.c    Sun Sep  1 19:30:41 1991
  921. X***************
  922. X*** 8,14 ****
  923. X  
  924. X  --------------------------------------------------------------------------*/
  925. X  /*+:EDITS:*/
  926. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
  927. X  /*:08-11-1991-14:58-wht@n4hgf-new ttygets botched command history handler */
  928. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  929. X  /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  930. X--- 8,14 ----
  931. X  
  932. X  --------------------------------------------------------------------------*/
  933. X  /*+:EDITS:*/
  934. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
  935. X  /*:08-11-1991-14:58-wht@n4hgf-new ttygets botched command history handler */
  936. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  937. X  /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  938. X***************
  939. X*** 27,37 ****
  940. X  
  941. X  char *strdup();
  942. X  
  943. X- #ifdef WHT
  944. X- #define ICMDH_MAXCNT    100
  945. X- #else
  946. X  #define ICMDH_MAXCNT    50
  947. X- #endif
  948. X  #define ICMDH_MAXLEN    72
  949. X  
  950. X  typedef struct icmd_hist
  951. X--- 27,33 ----
  952. X*** /export/home/wht/src/ecu314/eculine.c    Wed Sep  4 00:25:05 1991
  953. X--- eculine.c    Tue Sep  3 19:56:56 1991
  954. X***************
  955. X*** 36,41 ****
  956. X--- 36,43 ----
  957. X  
  958. X  ------------------------------------------------------------------------*/
  959. X  /*+:EDITS:*/
  960. X+ /*:09-01-1991-14:18-wht@n4hgf2-on sun, use termios and improve ldraino */
  961. X+ /*:09-01-1991-02:51-wht@n4hgf2-sun CRTSCTS turn on bug fixed */
  962. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  963. X  /*:08-11-1991-18:06-wht@n4hgf-SCO_TTY_NAMING considerations */
  964. X  /*:08-06-1991-14:18-wht@n4hgf-baud rates below 300 get two stop bits */
  965. X***************
  966. X*** 62,68 ****
  967. X  # include <sys/termiox.h>
  968. X  int hx_flag;
  969. X  #endif
  970. X- extern int sigint;        /* SIGINT flag: see xmtr_SIGINT_handler */
  971. X  
  972. X  int lgetc_count;
  973. X  
  974. X--- 64,69 ----
  975. X***************
  976. X*** 198,204 ****
  977. X  int delim_len;
  978. X  long quantum;
  979. X  long ltmp;
  980. X- long Nap();
  981. X  
  982. X      delim_len = (lrwt->delim) ? strlen(lrwt->delim) : 0;
  983. X  
  984. X--- 199,204 ----
  985. X***************
  986. X*** 416,422 ****
  987. X  {
  988. X  uchar rtn_char;
  989. X  #if defined(NO_SELECT)
  990. X- long Nap();
  991. X  long timeout;
  992. X  
  993. X  AGAIN:
  994. X--- 416,421 ----
  995. X***************
  996. X*** 568,574 ****
  997. X--- 567,591 ----
  998. X  ldraino(inflush_flag)
  999. X  int inflush_flag;
  1000. X  {
  1001. X+ #if defined(sun)
  1002. X+ int retries = 50;
  1003. X+ int outq_count;
  1004. X+ int old_outq_count = 0;
  1005. X+ 
  1006. X+     do {
  1007. X+         ioctl(shm->Liofd,TIOCOUTQ,&outq_count);
  1008. X+         if(!outq_count)
  1009. X+             break;
  1010. X+         if(old_outq_count == outq_count) /* don't hang if flow control lock */
  1011. X+             retries--;
  1012. X+         old_outq_count = outq_count;
  1013. X+         Nap(50);
  1014. X+     } while(outq_count && retries);
  1015. X+     if(inflush_flag)
  1016. X+         ioctl(shm->Liofd,TCFLSH,TCIFLUSH);
  1017. X+ #else
  1018. X      ioctl(shm->Liofd,(inflush_flag) ? TCSETAF : TCSETAW,(char *)&Ltermio);
  1019. X+ #endif
  1020. X  
  1021. X  }    /* end of ldraino */
  1022. X  
  1023. X***************
  1024. X*** 664,669 ****
  1025. X--- 681,689 ----
  1026. X  {
  1027. X  int baud_selector = valid_baud_rate(shm->Lbaud);
  1028. X  
  1029. X+     if(shm->Liofd < 0)
  1030. X+         return(0);
  1031. X+ 
  1032. X      if(baud_selector == -1)
  1033. X          baud_selector = valid_baud_rate(shm->Lbaud = DEFAULT_BAUD_RATE);
  1034. X  
  1035. X***************
  1036. X*** 721,727 ****
  1037. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  1038. X      ioctl(shm->Liofd, TCSETX, &flowctrl);
  1039. X      hx_flag = flowctrl.x_hflag;
  1040. X! #else !SVR4
  1041. X  #if defined(RTSFLOW)    /* only SCO */
  1042. X      switch(flag)
  1043. X      {
  1044. X--- 741,747 ----
  1045. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  1046. X      ioctl(shm->Liofd, TCSETX, &flowctrl);
  1047. X      hx_flag = flowctrl.x_hflag;
  1048. X! #else /* !SVR4 */
  1049. X  #if defined(RTSFLOW)    /* only SCO */
  1050. X      switch(flag)
  1051. X      {
  1052. X***************
  1053. X*** 761,767 ****
  1054. X  
  1055. X          default:
  1056. X              Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  1057. X!             Ltermio.c_cflag |= ~(CRTSCTS);
  1058. X              break;
  1059. X  
  1060. X      }
  1061. X--- 781,787 ----
  1062. X  
  1063. X          default:
  1064. X              Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  1065. X!             Ltermio.c_cflag |= CRTSCTS;
  1066. X              break;
  1067. X  
  1068. X      }
  1069. X***************
  1070. X*** 799,804 ****
  1071. X--- 819,827 ----
  1072. X  lset_parity(ioctl_flag)
  1073. X  int ioctl_flag;
  1074. X  {
  1075. X+     if(shm->Liofd < 0)
  1076. X+         return;
  1077. X+ 
  1078. X      Ltermio.c_cflag &= ~(CS8 | PARENB | PARODD);
  1079. X      switch(to_lower(shm->Lparity))
  1080. X      {
  1081. X***************
  1082. X*** 857,867 ****
  1083. X  int
  1084. X  lopen()
  1085. X  {
  1086. X! int itmp;
  1087. X! struct stat ttystat;
  1088. X  
  1089. X-     lopen_err_str[0] = 0;
  1090. X- 
  1091. X      /*
  1092. X       * system independent checks
  1093. X       */
  1094. X--- 880,888 ----
  1095. X  int
  1096. X  lopen()
  1097. X  {
  1098. X!     int itmp;
  1099. X!     struct stat ttystat;
  1100. X  
  1101. X      /*
  1102. X       * system independent checks
  1103. X       */
  1104. X***************
  1105. X*** 875,894 ****
  1106. X      /*
  1107. X       * SCO system dependent checks
  1108. X       */
  1109. X! #if defined(M_SYSV)
  1110. X!     if(strncmp(shm->Lline,"/dev/tty",8))
  1111. X!         return(LOPEN_INVALID);
  1112. X  #endif /* M_SYSV */
  1113. X  
  1114. X      /*
  1115. X       * ISC system dependent checks
  1116. X       */
  1117. X! #if defined(ISC)
  1118. X      if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/acu",8))
  1119. X          return(LOPEN_INVALID);
  1120. X  #endif
  1121. X  
  1122. X      /*
  1123. X       * lock the tty 
  1124. X       */
  1125. X      if(itmp = lock_tty())        /* get lock file */
  1126. X--- 896,928 ----
  1127. X      /*
  1128. X       * SCO system dependent checks
  1129. X       */
  1130. X! #if defined(M_SYSV) /* && defined(SCO_TTY_NAMING) */
  1131. X!     /* device, lock file needs lower-case device name */
  1132. X!     itmp = strlen(shm->Lline) - 1;
  1133. X!     shm->Lline[itmp] = to_lower(shm->Lline[itmp]);
  1134. X  #endif /* M_SYSV */
  1135. X  
  1136. X      /*
  1137. X       * ISC system dependent checks
  1138. X       */
  1139. X! #if 0
  1140. X! #if defined(ISC) 
  1141. X      if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/acu",8))
  1142. X          return(LOPEN_INVALID);
  1143. X  #endif
  1144. X+ #endif
  1145. X  
  1146. X      /*
  1147. X+      * Sun system dependent checks
  1148. X+      */
  1149. X+ #if 0
  1150. X+ #if defined(sun)
  1151. X+     if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/cua",8))
  1152. X+         return(LOPEN_INVALID);
  1153. X+ #endif
  1154. X+ #endif
  1155. X+ 
  1156. X+     /*
  1157. X       * lock the tty 
  1158. X       */
  1159. X      if(itmp = lock_tty())        /* get lock file */
  1160. X***************
  1161. X*** 895,901 ****
  1162. X          return(itmp);
  1163. X  
  1164. X      /*
  1165. X!      * lock the tty 
  1166. X       */
  1167. X      if((shm->Liofd = open(shm->Lline,O_RDWR | O_NDELAY,0777)) < 0)
  1168. X      {
  1169. X--- 929,935 ----
  1170. X          return(itmp);
  1171. X  
  1172. X      /*
  1173. X!      * open the tty using non-blocking I/O to bypass DCD wait
  1174. X       */
  1175. X      if((shm->Liofd = open(shm->Lline,O_RDWR | O_NDELAY,0777)) < 0)
  1176. X      {
  1177. X***************
  1178. X*** 909,915 ****
  1179. X  
  1180. X  
  1181. X      /*
  1182. X!      * turn off non-blocking I/O
  1183. X       */
  1184. X      fcntl(shm->Liofd,F_GETFL,&itmp);
  1185. X      itmp &= ~O_NDELAY;
  1186. X--- 943,949 ----
  1187. X  
  1188. X  
  1189. X      /*
  1190. X!      * turn off non-blocking I/O and  set initial termio, including CLOCAL
  1191. X       */
  1192. X      fcntl(shm->Liofd,F_GETFL,&itmp);
  1193. X      itmp &= ~O_NDELAY;
  1194. X***************
  1195. X*** 925,934 ****
  1196. X      lset_baud_rate(0);        /* do not perform ioctl */
  1197. X      lset_parity(1);            /* do perform ioctl */
  1198. X  
  1199. X-     lopen_err_str[0] = 0;
  1200. X  #ifdef SVR4
  1201. X!     hx_flag = 0;
  1202. X  #endif
  1203. X      return(0);
  1204. X  
  1205. X  }    /* end of lopen */
  1206. X--- 959,969 ----
  1207. X      lset_baud_rate(0);        /* do not perform ioctl */
  1208. X      lset_parity(1);            /* do perform ioctl */
  1209. X  
  1210. X  #ifdef SVR4
  1211. X!     hx_flag = 0;            /* hardware flow control "memory" */
  1212. X  #endif
  1213. X+ 
  1214. X+     lopen_err_str[0] = 0;    /* no error this time! */
  1215. X      return(0);
  1216. X  
  1217. X  }    /* end of lopen */
  1218. X*** /export/home/wht/src/ecu314/ecunumrev.c    Wed Sep  4 00:25:05 1991
  1219. X--- ecunumrev.c    Tue Sep  3 19:35:29 1991
  1220. X***************
  1221. X*** 3,9 ****
  1222. X      wht@n4hgf.Mt-Park.GA.US
  1223. X  ------------------------------------------------------------------------*/
  1224. X  /*+:EDITS:*/
  1225. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
  1226. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1227. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1228. X  /*:07-12-1991-14:14-wht@n4hgf-GCC140 differentiation */
  1229. X--- 3,9 ----
  1230. X      wht@n4hgf.Mt-Park.GA.US
  1231. X  ------------------------------------------------------------------------*/
  1232. X  /*+:EDITS:*/
  1233. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
  1234. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1235. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1236. X  /*:07-12-1991-14:14-wht@n4hgf-GCC140 differentiation */
  1237. X***************
  1238. X*** 24,32 ****
  1239. X  #endif
  1240. X  
  1241. X  #ifdef WHT
  1242. X! char *numeric_revision = "x3.64";
  1243. X  #else
  1244. X! char *numeric_revision = "3";
  1245. X  #endif
  1246. X  char *revstr = "";
  1247. X  
  1248. X--- 24,32 ----
  1249. X  #endif
  1250. X  
  1251. X  #ifdef WHT
  1252. X! char *numeric_revision = "x3.73";
  1253. X  #else
  1254. X! char *numeric_revision = "x3";
  1255. X  #endif
  1256. X  char *revstr = "";
  1257. X  
  1258. X***************
  1259. X*** 70,78 ****
  1260. X  
  1261. X  #if defined(__GNUC__)
  1262. X  #if defined(GCC140)
  1263. X!     strcat(s128,"G");
  1264. X  #else
  1265. X!     strcat(s128,"g");
  1266. X  #endif
  1267. X  #if defined(__STDC__)
  1268. X      strcat(s128,"A");
  1269. X--- 70,78 ----
  1270. X  
  1271. X  #if defined(__GNUC__)
  1272. X  #if defined(GCC140)
  1273. X!     strcat(s128,"-G");
  1274. X  #else
  1275. X!     strcat(s128,"-g");
  1276. X  #endif
  1277. X  #if defined(__STDC__)
  1278. X      strcat(s128,"A");
  1279. X*** /export/home/wht/src/ecu314/ecuphone.c    Wed Sep  4 00:25:06 1991
  1280. X--- ecuphone.c    Tue Sep  3 18:59:00 1991
  1281. X***************
  1282. X*** 140,146 ****
  1283. X  extern int errno;
  1284. X  
  1285. X  extern int windows_active;
  1286. X- extern int sigint;
  1287. X  extern int rcvr_pid;
  1288. X  extern char errmsg[];
  1289. X  extern char kbdintr;
  1290. X--- 140,145 ----
  1291. X*** /export/home/wht/src/ecu314/ecuphrase.c    Wed Sep  4 00:24:42 1991
  1292. X--- ecuphrase.c    Tue Sep  3 18:59:16 1991
  1293. X***************
  1294. X*** 120,126 ****
  1295. X  extern char *phrases_string[]; 
  1296. X  extern int phrases_count;
  1297. X  extern int phrases_resident;
  1298. X- extern int sigint;
  1299. X  extern int icmd_prompt_len;
  1300. X  
  1301. X      for(itmp = icmd_prompt_len + strlen(nargv[0]); itmp; itmp--)
  1302. X--- 120,125 ----
  1303. X*** /export/home/wht/src/ecu314/ecusetup.c    Wed Sep  4 00:25:06 1991
  1304. X--- ecusetup.c    Tue Sep  3 19:42:45 1991
  1305. X***************
  1306. X*** 10,16 ****
  1307. X  03|  Telephone     ....................                          |
  1308. X  04|  Description   ........................................      |
  1309. X  05|                                                              |
  1310. X! 06|  tty: /dev/tty.....   (opened)                               | 
  1311. X  07|                                                              |
  1312. X  08|  duplex: .  baud: .....  parity: . (data bits .)             |
  1313. X  09|  add NL to transmitted CR: .                                 |
  1314. X--- 10,16 ----
  1315. X  03|  Telephone     ....................                          |
  1316. X  04|  Description   ........................................      |
  1317. X  05|                                                              |
  1318. X! 06|  tty: /dev/........   (opened)                               | 
  1319. X  07|                                                              |
  1320. X  08|  duplex: .  baud: .....  parity: . (data bits .)             |
  1321. X  09|  add NL to transmitted CR: .                                 |
  1322. X***************
  1323. X*** 34,40 ****
  1324. X  
  1325. X  --------------------------------------------------------------------------*/
  1326. X  /*+:EDITS:*/
  1327. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
  1328. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1329. X  /*:08-12-1991-00:58-wht@n4hgf-ISC tty names */
  1330. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1331. X--- 34,40 ----
  1332. X  
  1333. X  --------------------------------------------------------------------------*/
  1334. X  /*+:EDITS:*/
  1335. X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
  1336. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1337. X  /*:08-12-1991-00:58-wht@n4hgf-ISC tty names */
  1338. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1339. X***************
  1340. X*** 109,116 ****
  1341. X  #define RADDNL_LX    3
  1342. X  
  1343. X  extern char *revstr;    /* ecunumrev.c */
  1344. X- extern int rcvr_pid;
  1345. X- extern int sigint;
  1346. X  extern char errmsg[];
  1347. X  
  1348. X  WINDOW *setw;
  1349. X--- 109,114 ----
  1350. X***************
  1351. X*** 242,250 ****
  1352. X  
  1353. X  /*+-------------------------------------------------------------------------
  1354. X      setup_display_tty()
  1355. X! 000000000011111
  1356. X! 012345678901234
  1357. X! /dev/ttyxxxxxx
  1358. X  --------------------------------------------------------------------------*/
  1359. X  void
  1360. X  setup_display_tty()
  1361. X--- 240,248 ----
  1362. X  
  1363. X  /*+-------------------------------------------------------------------------
  1364. X      setup_display_tty()
  1365. X!      00000000
  1366. X!      01234567
  1367. X! /dev/........
  1368. X  --------------------------------------------------------------------------*/
  1369. X  void
  1370. X  setup_display_tty()
  1371. X***************
  1372. X*** 307,313 ****
  1373. X          wmove(setw,DESCR_Y,DESCR_LX);
  1374. X          waddstr(setw,"Description");
  1375. X          wmove(setw,TTY_Y,TTY_LX);
  1376. X!         waddstr(setw,"tty: /dev/tty");
  1377. X          wmove(setw,DPX_Y,DPX_LX);
  1378. X          waddstr(setw,"duplex:");
  1379. X          wmove(setw,BAUD_Y,BAUD_LX);
  1380. X--- 305,311 ----
  1381. X          wmove(setw,DESCR_Y,DESCR_LX);
  1382. X          waddstr(setw,"Description");
  1383. X          wmove(setw,TTY_Y,TTY_LX);
  1384. X!         waddstr(setw,"tty: /dev/");
  1385. X          wmove(setw,DPX_Y,DPX_LX);
  1386. X          waddstr(setw,"duplex:");
  1387. X          wmove(setw,BAUD_Y,BAUD_LX);
  1388. X*** /export/home/wht/src/ecu314/ecusighdl.c    Wed Sep  4 00:24:55 1991
  1389. X--- ecusighdl.c    Sun Sep  1 18:39:00 1991
  1390. X***************
  1391. X*** 205,210 ****
  1392. X--- 205,211 ----
  1393. X          case TERMECU_INIT_PROC_ERROR: return("error during initial procedure");
  1394. X          case TERMECU_CONFIG_ERROR: return("configuration error");
  1395. X          case TERMECU_CURSES_ERROR: return("error in curses use");
  1396. X+         case TERMECU_MALLOC: return("critical memory allocation failure");
  1397. X          default:
  1398. X              sprintf(errant,"code %u?",code);
  1399. X              return(errant);
  1400. X***************
  1401. X*** 285,291 ****
  1402. X              }
  1403. X          }
  1404. X          restore_initial_colors();
  1405. X! #ifdef WHT
  1406. X          xterm_title("xterm",0);
  1407. X  #endif
  1408. X      }
  1409. X--- 286,292 ----
  1410. X              }
  1411. X          }
  1412. X          restore_initial_colors();
  1413. X! #if defined(WHT) || defined(XTERM_FRIEND)
  1414. X          xterm_title("xterm",0);
  1415. X  #endif
  1416. X      }
  1417. X*** /export/home/wht/src/ecu314/ecutty.c    Wed Sep  4 00:24:55 1991
  1418. X--- ecutty.c    Tue Sep  3 19:02:13 1991
  1419. X***************
  1420. X*** 42,49 ****
  1421. X--- 42,73 ----
  1422. X      brown    6     yellow      14
  1423. X      white    7     hi_white    15
  1424. X  
  1425. X+     With Lothar's ISC SVR4, the format is
  1426. X+ 
  1427. X+      00000000001111111111222222222233
  1428. X+      01234567890123456789012345678901
  1429. X+      00000000000000000011????0100????
  1430. X+        0   0   0   0   3   f   4  o b
  1431. X+     where f is the foreground color
  1432. X+     and   b is the background color
  1433. X+ 
  1434. X+     (I dont have one, so I'm guessing these colors are chosen from
  1435. X+     the ISO colors:
  1436. X+ 
  1437. X+      BLACK       0
  1438. X+      RED         1
  1439. X+      GREEN       2
  1440. X+      YELLOW      3
  1441. X+      BLUE        4
  1442. X+      MAGENTA     5
  1443. X+      CYAN        6
  1444. X+      WHITE       7
  1445. X+ 
  1446. X  --------------------------------------------------------------------------*/
  1447. X  /*+:EDITS:*/
  1448. X+ /*:08-31-1991-13:29-wht@n4hgf2-look for colors in ECULIBDIR too */
  1449. X+ /*:08-30-1991-04:12-wht@n4hgf2-restore colors wrong to do now if not SCO */
  1450. X+ /*:08-30-1991-02:49-aega84!lh-use at_ansi.h/kd.h/CONS_GET under ISC SVR4 */
  1451. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1452. X  /*:08-17-1991-18:29-wht@n4hgf-add kbdtest command */
  1453. X  /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1454. X***************
  1455. X*** 64,73 ****
  1456. X  #include "ecuxkey.h"
  1457. X  #include "ecuerror.h"
  1458. X  #include "termecu.h"
  1459. X  #if defined(M_SYSV)
  1460. X  #   include <sys/machdep.h>
  1461. X  #else
  1462. X! #if defined(ISC)
  1463. X  #  include <sys/at_ansi.h>
  1464. X  #  include <sys/kd.h>
  1465. X  #endif /* ISC */
  1466. X--- 88,104 ----
  1467. X  #include "ecuxkey.h"
  1468. X  #include "ecuerror.h"
  1469. X  #include "termecu.h"
  1470. X+ 
  1471. X+ /*
  1472. X+  * This is how we determine whether we are on a color terminal or not.
  1473. X+  * We handle SCO XENIX, UNIX , ISC 2.2 aqnd ISC SVR4.
  1474. X+  * If you have trouble with this add some kind of thing instead of MYSYS
  1475. X+  * and mail me the full details.  Search for MYSYS throughout here.
  1476. X+  */
  1477. X  #if defined(M_SYSV)
  1478. X  #   include <sys/machdep.h>
  1479. X  #else
  1480. X! #if defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
  1481. X  #  include <sys/at_ansi.h>
  1482. X  #  include <sys/kd.h>
  1483. X  #endif /* ISC */
  1484. X***************
  1485. X*** 109,115 ****
  1486. X      XFhome        /* KDEk_HOME */
  1487. X  };
  1488. X  
  1489. X- extern int sigint;
  1490. X  extern int hz;
  1491. X  extern uint tcap_LINES;
  1492. X  extern uint tcap_COLS;
  1493. X--- 140,145 ----
  1494. X***************
  1495. X*** 154,160 ****
  1496. X  uchar *dole_out_tgc_accum = (uchar *)0;
  1497. X  int dole_out_tgc_accum_count = 0;
  1498. X  
  1499. X! #ifdef SVR4
  1500. X  ulong colors_current = 0x00003740;
  1501. X  ulong colors_normal = 0x00003740;    /* */
  1502. X  ulong colors_initial = 0x00003740;    /* */
  1503. X--- 184,199 ----
  1504. X  uchar *dole_out_tgc_accum = (uchar *)0;
  1505. X  int dole_out_tgc_accum_count = 0;
  1506. X  
  1507. X! /*
  1508. X!  * color definitions per format described at top of source
  1509. X!  * we handle SCO XENIX and UNIX and ISC SVR4 but not "MYSYS"
  1510. X!  * (search for MYSYS near top of source for clue what MYSYS means)
  1511. X!  *
  1512. X!  * As of this writing, I don't know about colors on ISC 2.2.
  1513. X!  * but they might be the same as for SVR4.
  1514. X!  *
  1515. X!  */
  1516. X! #if defined(SVR4)
  1517. X  ulong colors_current = 0x00003740;
  1518. X  ulong colors_normal = 0x00003740;    /* */
  1519. X  ulong colors_initial = 0x00003740;    /* */
  1520. X***************
  1521. X*** 162,168 ****
  1522. X  ulong colors_alert = 0x00003740L;    /* */
  1523. X  ulong colors_error = 0x00003140L;    /* */
  1524. X  ulong colors_notify = 0x00003340L;    /* */
  1525. X! #else
  1526. X  ulong colors_current = 0x04070A00L;
  1527. X  ulong colors_normal = 0x04070A00L;    /* default lt_green/black red/white */
  1528. X  ulong colors_initial = 0x04070A00L;    /* default initial colors */
  1529. X--- 201,207 ----
  1530. X  ulong colors_alert = 0x00003740L;    /* */
  1531. X  ulong colors_error = 0x00003140L;    /* */
  1532. X  ulong colors_notify = 0x00003340L;    /* */
  1533. X! #else    /* SCO XENIX and UNIX ---- other? */
  1534. X  ulong colors_current = 0x04070A00L;
  1535. X  ulong colors_normal = 0x04070A00L;    /* default lt_green/black red/white */
  1536. X  ulong colors_initial = 0x04070A00L;    /* default initial colors */
  1537. X***************
  1538. X*** 245,251 ****
  1539. X--- 284,292 ----
  1540. X  _setcolor(clrs)
  1541. X  ulong clrs;
  1542. X  {
  1543. X+ #ifdef SVR4
  1544. X      char fg[4], bg[4];
  1545. X+ #endif
  1546. X  
  1547. X      if(!use_colors || tty_not_char_special)
  1548. X          return;
  1549. X***************
  1550. X*** 256,262 ****
  1551. X      sprintf(bg,"%s", clrs & 0xFF);
  1552. X      ff(se,"\033[%sm", fg);
  1553. X      ff(se,"\033[%sm", bg);
  1554. X! #else
  1555. X      /* normal */
  1556. X      ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
  1557. X  
  1558. X--- 297,303 ----
  1559. X      sprintf(bg,"%s", clrs & 0xFF);
  1560. X      ff(se,"\033[%sm", fg);
  1561. X      ff(se,"\033[%sm", bg);
  1562. X! #else /* SCO */
  1563. X      /* normal */
  1564. X      ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
  1565. X  
  1566. X***************
  1567. X*** 352,362 ****
  1568. X  void
  1569. X  restore_initial_colors()
  1570. X  {
  1571. X! #ifdef M_UNIX
  1572. X!     setcolor(colors_initial);
  1573. X! #else
  1574. X!     setcolor(colors_normal);
  1575. X  #endif
  1576. X  }    /* end of restore_initial_colors */
  1577. X  
  1578. X  /*+-------------------------------------------------------------------------
  1579. X--- 393,408 ----
  1580. X  void
  1581. X  restore_initial_colors()
  1582. X  {
  1583. X! #if defined(M_UNIX) || defined(SVR4)
  1584. X!     if(use_colors)
  1585. X!         setcolor(colors_initial);
  1586. X!     else
  1587. X  #endif
  1588. X+     {
  1589. X+         tcap_blink_off();
  1590. X+         tcap_bold_off();
  1591. X+         tcap_underscore_off();
  1592. X+     }
  1593. X  }    /* end of restore_initial_colors */
  1594. X  
  1595. X  /*+-------------------------------------------------------------------------
  1596. X***************
  1597. X*** 429,435 ****
  1598. X      get_home_dir(s128);
  1599. X      strcat(s128,"/.ecu/colors");
  1600. X      if(access(s128,4))
  1601. X!         return;
  1602. X  
  1603. X      fp = fopen(s128,"r");
  1604. X  
  1605. X--- 475,486 ----
  1606. X      get_home_dir(s128);
  1607. X      strcat(s128,"/.ecu/colors");
  1608. X      if(access(s128,4))
  1609. X!     {
  1610. X!         get_home_dir(eculibdir);
  1611. X!         strcat(s128,"/colors");
  1612. X!         if(access(s128,4))
  1613. X!             return;
  1614. X!     }
  1615. X  
  1616. X      fp = fopen(s128,"r");
  1617. X  
  1618. X***************
  1619. X*** 505,511 ****
  1620. X--- 556,564 ----
  1621. X  uchar param;
  1622. X  {
  1623. X  int itmp;
  1624. X+ #if defined(M_SYSV) || defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
  1625. X  int monitor_type;
  1626. X+ #endif
  1627. X  char *cptr;
  1628. X  int fddevtty = open("/dev/tty",O_RDONLY,0);
  1629. X  
  1630. X***************
  1631. X*** 573,579 ****
  1632. X       * (I ain't proud of this beyond being a valiant attempt)
  1633. X       */
  1634. X      use_colors = 0;
  1635. X! #if defined(M_SYSV) || defined(ISC)
  1636. X      if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
  1637. X          (use_colors = (monitor_type != MONO)))
  1638. X      {
  1639. X--- 626,632 ----
  1640. X       * (I ain't proud of this beyond being a valiant attempt)
  1641. X       */
  1642. X      use_colors = 0;
  1643. X! #if defined(M_SYSV) || defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
  1644. X      if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
  1645. X          (use_colors = (monitor_type != MONO)))
  1646. X      {
  1647. X*** /export/home/wht/src/ecu314/ecuutil.c    Wed Sep  4 00:24:56 1991
  1648. X--- ecuutil.c    Tue Sep  3 22:37:30 1991
  1649. X***************
  1650. X*** 31,38 ****
  1651. X--- 31,48 ----
  1652. X      strip_trail_break(zstr)
  1653. X      yes_or_no(strarg)
  1654. X  
  1655. X+ 
  1656. X+ This module assumes the neo-standard 'mode_t' type is an unsigned
  1657. X+ short and 'dev_t' is a short in accordance with tradition.  This
  1658. X+ is, in fact, true with all the supported systems which have it as
  1659. X+ of this writing.  This is just a test of the Brown Shirt Warning
  1660. X+ System.  If this had been an actual Brown Shirt Alert, you would
  1661. X+ have heard the noise of sickening thuds and breaking things nearby.
  1662. X+ 
  1663. X  ------------------------------------------------------------------------*/
  1664. X  /*+:EDITS:*/
  1665. X+ /*:09-01-1991-12:46-wht@n4hgf2-show sun flow control bit */
  1666. X+ /*:08-30-1991-20:09-wht@n4hgf2-sun Nap was not returning a value */
  1667. X  /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1668. X  /*:08-17-1991-14:11-root@n4hgf-ascii_to_hex supports "csi" */
  1669. X  /*:08-13-1991-13:53-wht@n4hgf-UNIX and ISC nap() broken; XENIX still wins */
  1670. X***************
  1671. X*** 104,110 ****
  1672. X  #if defined(M_UNIX) && !defined(DUFF) /*  && !defined(__GNUC__) */
  1673. X      /*
  1674. X       * memmove() clobbers regs that GCC wants to keep
  1675. X!      * unless you use at least some of -fcall-save-{ax,bx,cx,dx}
  1676. X       */
  1677. X      memmove(dest,src,len);
  1678. X  #else
  1679. X--- 114,120 ----
  1680. X  #if defined(M_UNIX) && !defined(DUFF) /*  && !defined(__GNUC__) */
  1681. X      /*
  1682. X       * memmove() clobbers regs that GCC wants to keep
  1683. X!      * unless you use -fcall-save-bx
  1684. X       */
  1685. X      memmove(dest,src,len);
  1686. X  #else
  1687. X***************
  1688. X*** 277,283 ****
  1689. X--- 287,296 ----
  1690. X          return((char *)0);
  1691. X  
  1692. X      if(parsestr)
  1693. X+     {
  1694. X+         str_token_static = (char *)0;
  1695. X          parseptr = parsestr;
  1696. X+     }
  1697. X      else
  1698. X         parseptr = str_token_static;
  1699. X  
  1700. X***************
  1701. X*** 384,390 ****
  1702. X--- 397,406 ----
  1703. X          return((char *)0);
  1704. X  
  1705. X      if(parsestr)
  1706. X+     {
  1707. X+         str_token_static = (char *)0;
  1708. X          parseptr = parsestr;
  1709. X+     }
  1710. X      else
  1711. X         parseptr = str_token_static;
  1712. X  
  1713. X***************
  1714. X*** 659,671 ****
  1715. X                  (flag & CLOCAL) ? 1 : 0);
  1716. X  #if defined(RTSFLOW) || defined(SVR4)    /* only SCO and SVR4 */
  1717. X      pprintf(" RTSFLOW:%d  CTSFLOW:%d",
  1718. X  #ifdef SVR4
  1719. X                  (hx_flag & RTSXOFF ) ? 1 : 0,
  1720. X                  (hx_flag & CTSXON ) ? 1 : 0);
  1721. X- #else
  1722. X-                 (flag & RTSFLOW ) ? 1 : 0,
  1723. X-                 (flag & CTSFLOW ) ? 1 : 0);
  1724. X  #endif
  1725. X  #endif
  1726. X      pprintf("\n");
  1727. X  
  1728. X--- 675,690 ----
  1729. X                  (flag & CLOCAL) ? 1 : 0);
  1730. X  #if defined(RTSFLOW) || defined(SVR4)    /* only SCO and SVR4 */
  1731. X      pprintf(" RTSFLOW:%d  CTSFLOW:%d",
  1732. X+                 (flag & RTSFLOW ) ? 1 : 0,
  1733. X+                 (flag & CTSFLOW ) ? 1 : 0);
  1734. X+ #endif
  1735. X  #ifdef SVR4
  1736. X+     pprintf(" RTSXOFF:%d  CTSXON:%d",
  1737. X                  (hx_flag & RTSXOFF ) ? 1 : 0,
  1738. X                  (hx_flag & CTSXON ) ? 1 : 0);
  1739. X  #endif
  1740. X+ #ifdef CRTSCTS
  1741. X+     pprintf(" CRTSCTS:%d",(flag & CRTSCTS ) ? 1 : 0);
  1742. X  #endif
  1743. X      pprintf("\n");
  1744. X  
  1745. X***************
  1746. X*** 1074,1098 ****
  1747. X  As it is nap() is nearly useless.  I believe select() suffers
  1748. X  from the same deficiency (< 1000 msec timeout becomes 1000 msec) but
  1749. X  I haven't "proven" it yet.
  1750. X  --------------------------------------------------------------------------*/
  1751. X  long
  1752. X  Nap(msec)
  1753. X  long msec;
  1754. X  {
  1755. X! #if defined(sun)
  1756. X  struct timeval timer;
  1757. X!     timer.tv_sec = 0;
  1758. X!     timer.tv_usec = 1000L * msec;
  1759. X!     select(0,0,0,0,&timer);
  1760. X  #else
  1761. X  #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
  1762. X      return(nap(msec));
  1763. X  #else
  1764. X      if(msec < hzmsec)
  1765. X          msec = hzmsec;
  1766. X      if(nap(msec) < 0)
  1767. X          return(-1);
  1768. X      return(msec);
  1769. X  #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */
  1770. X  #endif /* sun */
  1771. X  
  1772. X--- 1093,1157 ----
  1773. X  As it is nap() is nearly useless.  I believe select() suffers
  1774. X  from the same deficiency (< 1000 msec timeout becomes 1000 msec) but
  1775. X  I haven't "proven" it yet.
  1776. X+ 
  1777. X+ On systems with a working select(), we use a relatively complex select
  1778. X+ arrangement to accomplish the nap requirement, but with an improvement.
  1779. X+ The "nap" survives any EINTR except for SIGINT (as indicated by sigint
  1780. X+ getting set).  On SIGINT, the nap is aborted.
  1781. X+ 
  1782. X+ A "working select" means
  1783. X+ 1. the system tries to support it (all but XENIX 286)
  1784. X+ 2. it is in libc.a (all but XENIX; see xsel386/* to fix XENIX 386)
  1785. X+ 3. it is not broken (XENIX 386 select fails on ttys, but can be
  1786. X+       fixed: see xsel386/*; even an "unfixed" XENIX select would work
  1787. X+       here because we are only interested in timeouts)
  1788. X+ 4. it times out properly (SCO UNIX 3.2.[1-2] screws up by ROUNDING
  1789. X+       timeouts UP to ONE SECOND).
  1790. X  --------------------------------------------------------------------------*/
  1791. X  long
  1792. X  Nap(msec)
  1793. X  long msec;
  1794. X  {
  1795. X! #if defined(WORKING_SELECT)
  1796. X! /*
  1797. X!  * Compute  A -= B for timeval structs A, B (thanks to ping.c)
  1798. X!  */
  1799. X! #define tvsub(A, B) \
  1800. X!     (A)->tv_sec -= (B)->tv_sec ;\
  1801. X!     if (((A)->tv_usec -= (B)->tv_usec) < 0)\
  1802. X!         { (A)->tv_sec--; (A)->tv_usec += 1000000; }
  1803. X! 
  1804. X  struct timeval timer;
  1805. X! struct timeval start;
  1806. X! struct timeval now;
  1807. X! struct timezone trash;
  1808. X! 
  1809. X!     gettimeofday(&start,&trash);
  1810. X!     timer.tv_sec = msec / 1000;
  1811. X!     timer.tv_usec = (msec % 1000L) * 1000L;
  1812. X!     while( ((timer.tv_sec * 1000000 + timer.tv_usec) > 0) &&
  1813. X!         (select(32,0,0,0,&timer) < 0) && (errno == EINTR))
  1814. X!     {
  1815. X!         if(sigint)        /* if SIGINT posted, exit now */
  1816. X!             return(-1);
  1817. X!         gettimeofday(&now,&trash);
  1818. X!         tvsub(&now,&start);
  1819. X!         tvsub(&timer,&now);
  1820. X!     }
  1821. X!     return(msec);
  1822. X  #else
  1823. X  #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
  1824. X      return(nap(msec));
  1825. X  #else
  1826. X+ #if defined(M_UNIX) || defined(ISC) 
  1827. X      if(msec < hzmsec)
  1828. X          msec = hzmsec;
  1829. X      if(nap(msec) < 0)
  1830. X          return(-1);
  1831. X      return(msec);
  1832. X+ #else
  1833. X+ # include "porting.attention.needed.here"
  1834. X+ #endif /* use hacked nap */
  1835. X  #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */
  1836. X  #endif /* sun */
  1837. X  
  1838. X***************
  1839. X*** 1101,1109 ****
  1840. X  /*+-------------------------------------------------------------------------
  1841. X      rdchk(fd) - for systems without it but with FIONREAD
  1842. X  --------------------------------------------------------------------------*/
  1843. X! #if defined(sun)
  1844. X  int
  1845. X  rdchk(fd)
  1846. X  {
  1847. X  int chars_waiting;
  1848. X  
  1849. X--- 1160,1169 ----
  1850. X  /*+-------------------------------------------------------------------------
  1851. X      rdchk(fd) - for systems without it but with FIONREAD
  1852. X  --------------------------------------------------------------------------*/
  1853. X! #if defined(BSD)
  1854. X  int
  1855. X  rdchk(fd)
  1856. X+ int fd;
  1857. X  {
  1858. X  int chars_waiting;
  1859. X  
  1860. X*** /export/home/wht/src/ecu314/ecuwinutil.c    Wed Sep  4 00:24:56 1991
  1861. X--- ecuwinutil.c    Sun Sep  1 18:39:26 1991
  1862. X***************
  1863. X*** 41,49 ****
  1864. X  #define ulong unsigned long
  1865. SHAR_EOF
  1866. true || echo 'restore of PATCH5.01 failed'
  1867. fi
  1868. echo 'End of ecu/patch05 part 2'
  1869. echo 'File PATCH5.01 is continued in part 3'
  1870. echo 3 > _shar_seq_.tmp
  1871. exit 0
  1872.  
  1873. exit 0 # Just in case...
  1874.